<?php

/**
 * @author shuang
 * @date 2016-10-26 14:00:49
 */
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use common\components\MTools;
$this->registerCssFile("/css/validate.css");
$this->registerCssFile("/js/ui-dialog.css");
$this->registerCssFile("/css/jquery.datatables.css");
$this->registerJsFile("/js/dialog-plus-min.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJsFile("/js/jquery.zclip.min.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
echo $this->render("//layouts/breadcrumb", ["url" => Url::toRoute(["profile/userbind"]), "title" => "代理详情"]);
?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12 well ibox float-e-margins">
            <div class="ibox-title">代理详情 <span class="pull-right"> 邀请码：<?php echo Yii::$app->user->identity->my_code; ?></span></div>
            <div class="well-content ibox-content">
                <div class="table-responsive">
                    <div id="table1_wrapper" class="dataTables_wrapper no-footer">
                        <table id="table1" class="table dataTable no-footer" role="grid" aria-describedby="table1_info">
                            <thead>
                                <tr role="row">
                                    <th  aria-sort="ascending">名称</th>
                                    <th>QQ</th>
                                    <th >级别</th>
                                    <th >添加时间</th>
                                    <th >任务数</th>
                                    <th >充值额</th>
                                    <th >最后登录</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($data as $item): ?>
                                    <tr class="gradeA odd" role="row">
                                        <td class="sorting_1"><?php echo ArrayHelper::getValue($item, "username"); ?></td>
                                        <td><?php echo ArrayHelper::getValue($item, "qq"); ?></td>
                                        <td><?php echo ArrayHelper::getValue($item, "gradename"); ?></td>
                                        <td><?php echo Yii::$app->formatter->asDatetime(ArrayHelper::getValue($item, "created_at")); ?></td>
                                        <td class="center"><?php echo MTools::IntFormat(ArrayHelper::getValue($item, "taskcount")); ?></td>
                                        <td class="center"><?php echo Yii::$app->formatter->asDecimal(ArrayHelper::getValue($item, "amount")); ?></td>
                                        <td><?php echo Yii::$app->formatter->asDatetime(ArrayHelper::getValue($item, "last_login_at")); ?></td>
                                    </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="pagination" style="float:right;">
                        <?php
                        echo
                        \yii\widgets\LinkPager::widget([
                            'pagination' => $pager,
                            'nextPageLabel' => '下一页',
                            'prevPageLabel' => '上一页',
                        ]);
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>